package com.chey.controller;

import com.chey.domain.Arpt;
import com.chey.domain.ResponseData;
import com.chey.domain.Updata;
import com.chey.service.DetailService;
import com.sun.tools.jconsole.JConsoleContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author JanYao
 * @version 0.1
 */
@RestController
public class DetailController {
    @Autowired
    private DetailService detailService;
    @PostMapping("/detail")
    public ResponseData detail(@RequestBody Updata updata){
        System.out.println(updata);
        List<Arpt> detail = detailService.detail(updata);
        ResponseData data = new ResponseData();
        data.setCode(200);
        data.setData(detail);
        System.out.println(data);
        return data;
    }
}
